﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XTeam.Core.Interface;
using System.ComponentModel;

namespace XTeam.Document.Entities
{
    /// <summary>
    /// 分类实体
    /// </summary>
    [Serializable]
    public class ArticleClassifyEntity : IClassifyEntity, ICloneable
    {


        /// <summary>
        /// 分类ID
        /// </summary>
        public int ClassId
        {
            get;
            set;
        }

        /// <summary>
        /// 分类名
        /// </summary>
        public string ClassName
        {
            get;
            set;
        }

        /// <summary>
        /// 父ID
        /// </summary>
        public int ParentId
        {
            get;
            set;
        }

        /// <summary>
        /// 层级
        /// </summary>
        public int Floor
        {
            get;
            set;
        }

        /// <summary>
        /// 路径
        /// </summary>
        public string Path
        {
            get;
            set;
        }
        /// <summary>
        /// 父级
        /// </summary>
        public IClassifyEntity Parent
        {
            get;
            set;
        }
        /// <summary>
        /// 子代
        /// </summary>
        public IList<IClassifyEntity> Children
        {
            get;
            set;
        }

        /// <summary>
        /// 有效性
        /// </summary>
        public bool IsValid
        {
            get;
            set;
        }

        public void Clone(IClassifyEntity source)
        {
            this.Children = source.Children;
            this.ClassId = source.ClassId;
            this.ClassName = source.ClassName;
            this.Floor = source.Floor;
            this.IsValid = source.IsValid;
            this.Parent = source.Parent;
            this.ParentId = source.ParentId;
            this.Path = source.Path;
        }

        public object Clone()
        {
            return this.MemberwiseClone();
        }
    }
}
